home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / dino / dino_bot.1 / examples / helloworld / ex1.d next >
Encoding:
Text File  |  1991-03-10  |  1.3 KB  |  35 lines

  1. /* Copyright, 1990, Regents of the University of Colorado */
  2. /* This program prints out messages from a one dimensional environment
  3.  * structure. */
  4.  
  5. #define P 16
  6.  
  7. environment node[P:id] {        /* ==> Declaration of a one dimensional
  8.                                        environment structure of size P, with an
  9.                                        environment index identifier id, which
  10.                                        tells WHICH environment we are. */
  11.  
  12.   composite go()                /* ==> Declaration of a composite
  13.                                        procedure with no parameters. */
  14.   {
  15.     printf ("node[%d] says hello\n", id);
  16.   }
  17.  
  18. }
  19.  
  20. environment host {              /* ==> Declaration of a scalar environment
  21.                                        structure "host" is required in
  22.                                        all DINO programs. */
  23.  
  24.   void main ()                  /* ==> Execution starts at function
  25.                                        "main" within environment "host"
  26.                                        in all DINO programs. */
  27.   {
  28.     printf ("host says hello\n");
  29.  
  30.     go()#;                      /* ==> Call of a composite procedure
  31.                                        (indicated by the "#" sign). */
  32.     printf ("host says goodbye\n");
  33.   }
  34. }
  35.